﻿

class DefaultDrawGrid extends BaseDrawGrid {

    colors = ["#FFFFFF", "#000000", "#000000", "#AAAAAA", "#00BB00"];

    Draw(drawArea: IDrawArea) {
        super.Draw(drawArea);
      
        for (var x = 0; x < this.grid.Width; x++) {
            for (var y = 0; y < this.grid.Height; y++) {
                var cell = this.grid.GetCell(x, y);
                var state = this.grid.GetCell(x, y).State;
                if (this.grid.GetCell(x, y).State == CellState.Dead)
                    drawArea.GetRenderingContext().fillStyle = drawArea.GetBackgroundColor();
                else
                    drawArea.GetRenderingContext().fillStyle = this.colors[state];

                drawArea.GetRenderingContext().fillRect(x * this.rectWidthInt, y * this.rectHeightInt, this.rectWidthInt, this.rectHeightInt);
            }

        }

   
    }
}